<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>填写定制信息</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/page.css">
    <script src="../js/jquery-3.2.1.min.js"></script>
    <script src="../js/media.js"></script>
    <script src="../js/common.js"></script>
	<style>
		select {
			resize: none;
			width: 3.51rem;
			height: 0.3rem;
			line-height: 0.3rem;
			padding:0 0.12rem;
			margin: 0 0.1rem;
			box-sizing: border-box;
		}
	</style>
</head>
<body>
	<!--
    	作者：chengzhanpeng@163.com
    	时间：2017-10-20
    	描述：修改！
    -->
    <!--头部-->
  <!--  <div class="public-header flex">
        &lt;!&ndash;<span class="public-header-left-search"></span>&ndash;&gt;
        <span class="public-header-left-back"></span>
        <span class="public-header-center">填写定制信息</span>
        <span class="public-header-right"></span>
    </div>-->

    <!--正文-->
<div class="Fill-in-custom-information bc-gray">
	<p class="title">定制信息：</p>
	<textarea name="" id="t1" cols="30" rows="10" placeholder="请填写定制信息"></textarea>
	<!--<p class="title">定制种类：</p>-->
	<!--<textarea name="" id="t2" cols="30" rows="10" placeholder="请填写定制种类"></textarea>-->
	<!--<select>
		<!--<option value="123">定制种类1</option>
		<option value="456">定制种类2</option>
		<option value="789">定制种类3</option>
		<option value="147">定制种类4</option>
	</select>-->
	<p class="title">描述：</p>
	<textarea name="" id="t3" cols="30" rows="10" placeholder="请填写定制描述"></textarea>
	<div id="pay_img" style="display: none;">
		<p class="title">点击识别二维码付款：</p>
		<img src="../img/二维码@3x 2.png" alt="">
	</div>
	<p class="title t1" id="pay_price">
		定制价格:
		<font></font><span>元</span>
	</p>
	<span class="button">立即定制</span>
</div>


    <script>
        $(function () {
        	var s_id = getQueryString('s_id');
        	var price = getQueryString('price');
        	var produId = getQueryString('productId')
        	if(price!=undefined&&price!='undefined'){
        		$('#pay_price font').text(price);
        	}else{
        		$('#pay_price font').text('暂无报价');
        		$('#pay_price span').text('');
        	}
        	$.ajax({
        		type:"get",
        		url:"http://www.yunnantese.com/ZITAOHUI/getStoreType?storeId="+s_id,
        		async:true,
        		success:function(data){
        			console.log(data);
        			if(data.code==1){
        				var str='';
        				for(var i=0;i<data.extend.list.length;i++){
        					if(data.extend.list[i].price!=undefined&&data.extend.list[i].price!=null&&data.extend.list[i].price!=''){
        						str += "<option value="+data.extend.list[i].price+">"+data.extend.list[i].second_type+"</option>";
        					}else{
        						str += "<option value="+"暂无定价"+">"+data.extend.list[i].second_type+"</option>";
        					}
        				}
        			}
        		}
        	});
//            $('#pay_img').css('display', 'none');
            $('.button').on('click', function () {//点击定制时保存数据并发送
//                if ($('#pay_img').css('display') == 'none') {
//                    $('#pay_img').css('display', 'block');
//                    $('#pay_price').hide();
//                } else {
                    var info = '';
                    var dingInf = sessionStorage.setItem('dingInf',$('#t1').val());//定制信息；
                    var miaoInf = sessionStorage.setItem('miaoInf',$('#t3').val());//描述信息
                    info += $('#t1').val() + ',';
                   // info += $('#t2').val() + ',';
                    info += $('#t3').val();
/*                    $.ajax({
                        url: base_url + 'ZITAOHUI/order/order',
                        data: {
                            info: info,
                            price: $('#pay_price font').html(),
                            uid: sessionStorage.getItem("uid"),
                            storeid: s_id,
                        },
                        success: function (data) {
                            if (data.code == 1) {
                                window.location.href = '../page/my-address.html?order_id=' + data.extend.data+"&price="+price+"&produce_con=1"+"&storeId="+s_id+'&produceid='+produId
                            }
                        }
                    })*/
                     //window.location.href = '../page/my-address.html?order_id=' + data.extend.data+"&price="+price+"&produce_con=1"+"&storeId="+s_id+'&produceid='+produId+'&dinginf='+dingInf+'&miaoinf='+miaoInf
                     window.location.href = '../page/my-address.html?price='+price+"&produce_con=1"+"&storeId="+s_id+'&produceid='+produId;
//                }
           })
           $('select').change(function(){
           	   var val = $(this).val();
           	   console.log(val);
           	   $('.t1 font').text(val);
           	   if(val==undefined||val=="undefined"||val=='暂无定价'){
           	   		$('.t1 span').text('');
           	   }else{
           	   		$('.t1 span').text('元');
           	   }
           })
        })
    </script>
</body>

</html>